<?php
class XException extends Exception {
	private $locales = array();
	
	function __construct($message, $code = 0, $locales = array()) {
		parent::__construct($message, $code);
		foreach($locales as $key => $value){
			$this->addLocaleMessage($key, $value);
		}
	}
	
	function addLocaleMessage($locale, $message) {
		$this->locales[$locale] = $message;
	}
	
	function getLocaleMessage($locale) {
		if(!isset($this->locales[$locale])){
			return $this->locales[$locale];
		}
		return null;
	}
}
?>